import 'package:base_flutter/base_flutter.dart';
import 'package:fan_da_app/res/drawables.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_svg/svg.dart';

import '../view_model/circle_home_view_model.dart';

class CircleHomePage extends BaseStatefulMvvmWidget {
  @override
  State<StatefulWidget> createState() => _CircleHomeState();
}

class _CircleHomeState extends BaseMvvmState<CircleHomeViewModel, CircleHomePage> {
  @override
  Widget? buildLoadingContentView() {
    return Stack(
      children: [
        Container(
          color: Color(0xffFFE8B6),
        ).setLocation(left: 0, right: 0, top: 0, bottom: 0),
        SvgPicture.asset(
          our_family,
          alignment: Alignment.topCenter,
        ),
        TextButton(
          onPressed: () {
            viewModel.createCircle();
          },
          child: Text(
            "创  建  圈  子",
            style: TextStyle(
                color: Colors.white, fontSize: 22, fontFamily: 'alimama'),
          ),
          style: ButtonStyle(
            backgroundColor: MaterialStateProperty.all(mainColor),
            minimumSize: MaterialStateProperty.all(Size.fromHeight(55)),
            shape: MaterialStateProperty.all(RoundedRectangleBorder(
                borderRadius: 8.borderRadius,
                side: BorderSide(color: Colors.white, width: 3.5))),
          ),
        ).setLocation(bottom: 210, left: 40, right: 40),

        Row(
          children: [
            TextButton(
              onPressed: () {

              },
              child: Text(
                "加  入  圈  子",
                style: TextStyle(
                    color: Colors.white, fontSize: 22, fontFamily: 'alimama'),
              ),
              style: ButtonStyle(
                backgroundColor: MaterialStateProperty.all(mainColor),
                minimumSize: MaterialStateProperty.all(Size.fromHeight(55)),
                shape: MaterialStateProperty.all(RoundedRectangleBorder(
                    borderRadius: 8.borderRadius,
                    side: BorderSide(color: Colors.white, width: 3.5))),
              ),
            ).setWeight(1),
            // SizedBox(width: 10,),
            // TextButton(
            //   onPressed: () {
            //
            //   },
            //   child: Text(
            //     "邀请搭子",
            //     style: TextStyle(
            //         color: Colors.white, fontSize: 22, fontFamily: 'alimama'),
            //   ),
            //   style: ButtonStyle(
            //     backgroundColor: MaterialStateProperty.all(mainColor),
            //     minimumSize: MaterialStateProperty.all(Size.fromHeight(55)),
            //     shape: MaterialStateProperty.all(RoundedRectangleBorder(
            //         borderRadius: 8.borderRadius,
            //         side: BorderSide(color: Colors.white, width: 3.5))),
            //   ),
            // ).setWeight(1),
          ],
        ).setLocation(bottom: 145, left: 40, right: 40)
      ],
    );
  }

  @override
  Widget buildRootView(BuildContext context, Widget loadingContentWidget) {
    return loadingContentWidget;
  }

  @override
  CircleHomeViewModel createViewModel() {
    return CircleHomeViewModel(context);
  }

  @override
  void onRetryClick() {}
}
